package com.qjyy.c.exceptions;

import com.qjyy.c.ienum.IEnum;

/**
 * @Author: Martin-WuHaoran
 * @Date: 2019-02-27 16:18
 * @Description:
 */
public class QjyyException extends RuntimeException {
    private int code;
    private String message;

    public QjyyException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public QjyyException(String message) {
        super(message);
    }
    public QjyyException(IEnum exceptionEnum){
        super(exceptionEnum.getMessage());
        code=exceptionEnum.getCode();
        message=exceptionEnum.getMessage();
    }
    public QjyyException(IEnum exceptionEnum,String message){
        super(message);
        this.code=exceptionEnum.getCode();
        this.message=message;
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
